<template>
  <el-config-provider :size="globalComSize" :locale="zhCn">
    <router-view></router-view>
  </el-config-provider>
</template>

<script lang="ts" setup>
import {
  computed,
  watch
} from 'vue';

// 配置element中文
import zhCn from 'element-plus/es/locale/lang/zh-cn';
import { useRouter } from 'vue-router';

import { useSettingStore } from '@/store/modules/setting';
import { useUserStore } from '@/store/modules/user';

const router = useRouter()
const SettingStore = useSettingStore()
const UserStore = useUserStore()
// 配置全局组件大小
const globalComSize = computed((): string => SettingStore.themeConfig.globalComSize)
const token = computed(() => UserStore.token)
watch(token, (val) => {
  if (!val) {
    router.push('/login')
  }
})
</script>
<style lang="scss">
@font-face {
  font-family: 'SourceHanSansSC-Bold';
  src: url('https://wuzhou-prd.oss.5c.group/front-rainbow/SourceHanSansSC-Bold.otf');
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: 'SourceHanSerifSC-SemiBold';
  src: url('https://wuzhou-prd.oss.5c.group/front-rainbow/SourceHanSerifSC-SemiBold.otf');
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: 'SourceHanSerifSC-Regular';
  src: url('https://wuzhou-prd.oss.5c.group/front-rainbow/SourceHanSansSC-Regular.otf');
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: 'SourceHanSansSC-Medium';
  src: url('https://wuzhou-prd.oss.5c.group/front-rainbow/SourceHanSansSC-Medium.otf');
  font-weight: bold;
  font-style: normal;
}
</style>
<style lang="scss">
#app {
  position: relative;
  width: 100%;
  height: 100%;
  font-family: Avenir, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;

  .el-drawer__header {
    border-bottom: 1px solid #ebeef5;
    padding: 20px 20px 19px;
    margin-bottom: 6px;
  }

  .el-dropdown-link:focus {
    outline: none;
  }
}

.el-pager li:focus {
  border: none;
}

.el-dropdown:focus {
  border: none;
}

.svg-icon:focus {
  border: none;
}

.el-drawer__title {
  font-weight: 600;
  font-size: 18px;
  color: black;
}

.el-dialog {
  // --el-dialog-padding-primary: 40px;
  padding: 20px;
  border-radius: 20px;
}

.el-dialog__title {
  font-weight: 600;
  font-size: 24px;
  color: black;
}

.el-dialog__body {
  padding-bottom: 10px;
}

.el-dialog__headerbtn {
  top: 10px;
  height: 64px;
}

.el-link {
  margin-right: 10px;
  margin-left: 10px;
}

.el-link .el-icon--right.el-icon {
  vertical-align: text-bottom;
}

.el-form-item--default {
  margin-bottom: 14px;
}
</style>

